﻿#include "2025年5月17日-review_list_cpp.h"

#include<vector>
using namespace std;

namespace linhui
{
	class A
	{
	public:
		int _a1 = 0;
		int _a2 = 0;
	};
	void test_PushBack()
	{

		list<int> li = { 4,3,6,9,12,7 };
		/*li.erase(li.begin());
		li.erase(li.find(3));
		li.erase(li.find(12));
		li.erase(li.find(7));*/
		/*li.pop_back();
		li.pop_front();*/
		li.clear();
		//li.push_front(1000);
		PrintContainer(li);
		/*const list<int> li = {4,3,6,9,12,3};
		list<int>::const_iterator it = li.rbegin();
		while (it != li.rend())
		{
			cout << *it << " "; 
			++it;
		}
		cout << endl;*/
		/*for (auto au : li)
		{
			cout << au;
		}*/

		/*list<int> li;
		li.push_back(8);
		li.push_back(1);
		li.push_back(3);
		li.push_back(4);
		li.push_back(6);
		for (auto au : li)
		{
			cout << au;
		}*/

		//list<A> li;
		//li.push_back(A());
		//li.push_back(A());
		//li.push_back(A());
		//li.push_back(A());
		//li.push_back(A());
		//list<A>::const_iterator it = li.rbegin();
		//while (it != li.rend())
		//{
		//	cout << it->_a1 << " " << it->_a2; //现在的方式,简洁清爽!!!
		//	//cout << (*it)._a1 << " " << (*it)._a2;//刚才的方式
		//	++it;
		//}
	}
	void testConstruct()
	{
		vector<int> v{ 4,1,2,3,4 };
		list<int> li(v.begin(), v.end());
		list<int> copy(li);
		list<int> equl = li;
		PrintContainer(li);
		PrintContainer(copy);
		PrintContainer(equl);
	}
}
int main()
{
	linhui::testConstruct();
	//linhui::test_PushBack();
	cout << "Hello world" << endl;
	return 0;
}
